package com.cnc.utils;

import java.util.List;

public class PageUtil {
    private int off;
    private int len;
    private int countRows;
    private int pageSize;
    private int currentPage;
    private Object result;

    public PageUtil(String pageSize,String currentPage) {
        this.pageSize = Integer.parseInt(pageSize);
        this.currentPage = Integer.parseInt(currentPage);
        init_len();
        init_off();
    }

    private void init_off(){
        off=(currentPage-1)*pageSize;
    }
    private void init_len(){
        len=pageSize;
    }

    public void setCountRows(int countRows) {
        this.countRows = countRows;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    public int getOff() {
        return off;
    }

    public int getLen() {
        return len;
    }

    public int getCountRows() {
        return countRows;
    }

    public int getPageSize() {
        return pageSize;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public Object getResult() {
        return result;
    }
}
